﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DuBaiCoffee2.Model
{
    public class RobotModelLeft
    {
        private static RobotModelLeft instance;
        private RobotModelLeft() { }
        public static RobotModelLeft Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new RobotModelLeft();
                }
                return instance;
            }
        }
        #region 机器人左臂操作
        /// <summary>
        /// 制作咖啡左 开 8
        /// </summary>
        public void RobotKFJL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)40, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 制作咖啡左 关 8
        /// </summary>
        public void RobotKFJL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)40, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 到接杯点左 开 9
        /// </summary>
        public void RobotDJBDL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)41, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 到接杯点左 关 9
        /// </summary>
        public void RobotDJBDL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)41, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 到接杯点2左 开 10
        /// </summary>
        public void RobotDJBD2L_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)42, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 到接杯点2左 关 10
        /// </summary>
        public void RobotDJBD2L_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)42, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 到检测点左 开 11
        /// </summary>
        public void RobotDJCDL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)43, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 到检测点左 关 11
        /// </summary>
        public void RobotDJCDL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)43, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去接咖啡左 开 12
        /// </summary>
        public void RobotQJKFL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)44, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去接咖啡左 关 12
        /// </summary>
        public void RobotQJKFL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)44, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 咖啡接完左 开 13
        /// </summary>
        public void RobotKFJWL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)45, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 咖啡接完左 关 13
        /// </summary>
        public void RobotKFJWL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)45, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去打印机左 开 14
        /// </summary>
        public void RobotQDYJL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)46, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去打印机左 关 14
        /// </summary>
        public void RobotQDYJL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)46, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 打印完成左 开 15
        /// </summary>
        public void RobotDYWCL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)47, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 打印完成左 关 15
        /// </summary>
        public void RobotDYWCL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)47, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 无杯通知左 开 18
        /// </summary>
        public void RobotWBTZL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)50, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 无杯通知左 关 18
        /// </summary>
        public void RobotWBTZL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)50, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 接杯成功左 开 19
        /// </summary>
        public void RobotJBCGL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)51, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 接杯成功左 关 19
        /// </summary>
        public void RobotJBCGL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)51, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 加冰左 开 20
        /// </summary>
        public void RobotJBL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)52, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 加冰左 关 20
        /// </summary>
        public void RobotJBL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)52, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 打印左 开 21
        /// </summary>
        public void RobotDYL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)53, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 打印左 关 21
        /// </summary>
        public void RobotDYL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)53, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 拉花左 开 22
        /// </summary>
        public void RobotLHL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)54, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 拉花左 关 22
        /// </summary>
        public void RobotLHL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)54, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 拉花出餐左 开 24
        /// </summary>
        public void RobotLHCCL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)56, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 拉花出餐左 关 24
        /// </summary>
        public void RobotLHCCL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)56, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 加果糖左 开 25
        /// </summary>
        public void RobotJGTL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)57, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 加果糖左 关 25
        /// </summary>
        public void RobotJGTL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)57, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 果糖完成左 开 26
        /// </summary>
        public void RobotGTWCL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)58, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 果糖完成左 关 26
        /// </summary>
        public void RobotGTWCL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)58, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 招手左 开 27
        /// </summary>
        public void RobotZSL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)59, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 招手左 关 27
        /// </summary>
        public void RobotZSL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)59, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人停止运行左 开 30
        /// </summary>
        public void RobotJQRTZYXL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)62, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人停止运行左 关 30
        /// </summary>
        public void RobotJQRTZYXL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)62, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人运行左 开 31
        /// </summary>
        public void RobotJQRYXL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)63, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人运行左 关 31
        /// </summary>
        public void RobotJQRYXL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)63, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人报警确认左 开 32
        /// </summary>
        public void RobotJQRBJQRL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)64, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人报警确认左 关 32
        /// </summary>
        public void RobotJQRBJQRL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)64, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人上电左 开 33
        /// </summary>
        public void RobotJQRSDL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)65, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人上电左 关 33
        /// </summary>
        public void RobotJQRSDL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)65, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人下电左 开 34
        /// </summary>
        public void RobotJQRXDL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)66, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人下电左 关 34
        /// </summary>
        public void RobotJQRXDL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)66, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人使能左 开 35
        /// </summary>
        public void RobotJQRSNL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)67, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人使能左 关 35
        /// </summary>
        public void RobotJQRSNL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)67, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人下使能左 开 36
        /// </summary>
        public void RobotJQRXSNL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)68, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人下使能左 关 36
        /// </summary>
        public void RobotJQRXSNL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)68, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人暂停左 开 37
        /// </summary>
        public void RobotJQRZTL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)69, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人暂停左 关 37
        /// </summary>
        public void RobotJQRZTL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)69, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人继续运行左 开 38
        /// </summary>
        public void RobotJQRJXYXL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)70, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人继续运行左 关 38
        /// </summary>
        public void RobotJQRJXYXL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)70, false);
            }
            catch
            {
            }
        }
        #endregion
        #region 机器人左臂查询
        /// <summary>
        /// 到原点 8
        /// </summary>
        public bool LRobotDYD_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)8, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 出餐完成 9
        /// </summary>
        public bool LRobotCCWC_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)9, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 到达落杯器1 10
        /// </summary>
        public bool LRobotDDLBQ1_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)10, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 到达落杯器2 11
        /// </summary>
        public bool LRobotDDLBQ2_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)11, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 到达打印机 12
        /// </summary>
        public bool LRobotDDDYJ_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)12, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 到咖啡机 13
        /// </summary>
        public bool LRobotDKFJ_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)13, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 到接杯检测 14
        /// </summary>
        public bool LRobotDJBJC_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)14, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 到接冰点 15
        /// </summary>
        public bool LRobotDJBD_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)15, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 到拉花点 16
        /// </summary>
        public bool LRobotDLHD_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)16, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        ///到果糖点 17
        /// </summary>
        public bool LRobotDGTD_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)17, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 招手完成 18
        /// </summary>
        public bool LRobotZSWC_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)18, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1运行 30
        /// </summary>
        public bool LRobotJQRYX_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)30, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1报警 31
        /// </summary>
        public bool LRobotJQRBJ_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)31, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1急停 32
        /// </summary>
        public bool LRobotQJRJT_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)32, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1已开机 33
        /// </summary>
        public bool LRobotJQRYKJ_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)33, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1已上电 34
        /// </summary>
        public bool LRobotJQRYSD_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)34, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1已使能 35
        /// </summary>
        public bool LRobotJQRYSN_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)35, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1暂停 36
        /// </summary>
        public bool LRobotJQRZT_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)36, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1运动中 37
        /// </summary>
        public bool LRobotJQRYDZ_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)37, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        #endregion
    }
}
